package com.edgar.designpattern.iterator.dinermerger;

import java.util.ArrayList;

public class PancakeHouseMenuIterator implements Iterator {

	ArrayList menuItems;
	int position;

	public PancakeHouseMenuIterator(ArrayList menuItems) {
		super();
		this.menuItems = menuItems;
	}

	@Override
	public Object next() {
		return menuItems.get(position++);
	}

	@Override
	public boolean hasNext() {
		if (position >= menuItems.size()) {
			return false;
		}
		return true;
	}

}
